
<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module astrometer</title>
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>astrometer</strong></big></big> (version 1.8)</font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/meurer/ACS/Pipeline/Apsis/apsis-4.2.4/python/apsis/astrometer.py">/home/meurer/ACS/Pipeline/Apsis/apsis-4.2.4/python/apsis/astrometer.py</a></font></td></tr></table>
    <p><tt>License<br>
=======<br>
&nbsp;<br>
Copyright&nbsp;(c)&nbsp;2009,&nbsp;The&nbsp;Johns&nbsp;Hopkins&nbsp;University<br>
&nbsp;<br>
All&nbsp;rights&nbsp;reserved.<br>
&nbsp;<br>
Redistribution&nbsp;and&nbsp;use&nbsp;in&nbsp;source&nbsp;and&nbsp;binary&nbsp;forms,&nbsp;with&nbsp;or&nbsp;without<br>
modification,&nbsp;are&nbsp;permitted&nbsp;provided&nbsp;that&nbsp;the&nbsp;following&nbsp;conditions&nbsp;are&nbsp;met:<br>
&nbsp;<br>
Redistributions&nbsp;of&nbsp;source&nbsp;code&nbsp;must&nbsp;retain&nbsp;the&nbsp;above&nbsp;copyright&nbsp;notice,&nbsp;this<br>
list&nbsp;of&nbsp;conditions&nbsp;and&nbsp;the&nbsp;following&nbsp;disclaimer.&nbsp;&nbsp;Redistributions&nbsp;in&nbsp;binary<br>
form&nbsp;must&nbsp;reproduce&nbsp;the&nbsp;above&nbsp;copyright&nbsp;notice,&nbsp;this&nbsp;list&nbsp;of&nbsp;conditions&nbsp;and<br>
the&nbsp;following&nbsp;disclaimer&nbsp;in&nbsp;the&nbsp;documentation&nbsp;and/or&nbsp;other&nbsp;materials&nbsp;provided<br>
with&nbsp;the&nbsp;distribution.&nbsp;&nbsp;Neither&nbsp;the&nbsp;name&nbsp;of&nbsp;the&nbsp;Johns&nbsp;Hopkins&nbsp;University&nbsp;nor<br>
the&nbsp;names&nbsp;of&nbsp;its&nbsp;contributors&nbsp;may&nbsp;be&nbsp;used&nbsp;to&nbsp;endorse&nbsp;or&nbsp;promote&nbsp;products<br>
derived&nbsp;from&nbsp;this&nbsp;software&nbsp;without&nbsp;specific&nbsp;prior&nbsp;written&nbsp;permission.<br>
&nbsp;<br>
THIS&nbsp;SOFTWARE&nbsp;IS&nbsp;PROVIDED&nbsp;BY&nbsp;THE&nbsp;COPYRIGHT&nbsp;HOLDERS&nbsp;AND&nbsp;CONTRIBUTORS&nbsp;'AS<br>
IS'&nbsp;AND&nbsp;ANY&nbsp;EXPRESS&nbsp;OR&nbsp;IMPLIED&nbsp;WARRANTIES,&nbsp;INCLUDING,&nbsp;BUT&nbsp;NOT&nbsp;LIMITED<br>
TO,&nbsp;THE&nbsp;IMPLIED&nbsp;WARRANTIES&nbsp;OF&nbsp;MERCHANTABILITY&nbsp;AND&nbsp;FITNESS&nbsp;FOR&nbsp;A<br>
PARTICULAR&nbsp;PURPOSE&nbsp;ARE&nbsp;DISCLAIMED.&nbsp;IN&nbsp;NO&nbsp;EVENT&nbsp;SHALL&nbsp;THE&nbsp;COPYRIGHT<br>
HOLDER&nbsp;OR&nbsp;CONTRIBUTORS&nbsp;BE&nbsp;LIABLE&nbsp;FOR&nbsp;ANY&nbsp;DIRECT,&nbsp;INDIRECT,&nbsp;INCIDENTAL,<br>
SPECIAL,&nbsp;EXEMPLARY,&nbsp;OR&nbsp;CONSEQUENTIAL&nbsp;DAMAGES&nbsp;(INCLUDING,&nbsp;BUT&nbsp;NOT&nbsp;LIMITED<br>
TO,&nbsp;PROCUREMENT&nbsp;OF&nbsp;SUBSTITUTE&nbsp;GOODS&nbsp;OR&nbsp;SERVICES;&nbsp;LOSS&nbsp;OF&nbsp;USE,&nbsp;DATA,&nbsp;OR<br>
PROFITS;&nbsp;OR&nbsp;BUSINESS&nbsp;INTERRUPTION)&nbsp;HOWEVER&nbsp;CAUSED&nbsp;AND&nbsp;ON&nbsp;ANY&nbsp;THEORY&nbsp;OF<br>
LIABILITY,&nbsp;WHETHER&nbsp;IN&nbsp;CONTRACT,&nbsp;STRICT&nbsp;LIABILITY,&nbsp;OR&nbsp;TORT&nbsp;(INCLUDING<br>
NEGLIGENCE&nbsp;OR&nbsp;OTHERWISE)&nbsp;ARISING&nbsp;IN&nbsp;ANY&nbsp;WAY&nbsp;OUT&nbsp;OF&nbsp;THE&nbsp;USE&nbsp;OF&nbsp;THIS<br>
SOFTWARE,&nbsp;EVEN&nbsp;IF&nbsp;ADVISED&nbsp;OF&nbsp;THE&nbsp;POSSIBILITY&nbsp;OF&nbsp;SUCH&nbsp;DAMAGE.<br>
&nbsp;<br>
(This&nbsp;license&nbsp;is&nbsp;based&nbsp;on&nbsp;the&nbsp;BSD&nbsp;license<br>
&nbsp;<a href="http://www.opensource.org/licenses/bsd-license.html">http://www.opensource.org/licenses/bsd-license.html</a>)</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#fffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
    
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="cStringIO.html">cStringIO</a><br>
<a href="math.html">math</a><br>
<a href="os.html">os</a><br>
<a href="popen2.html">popen2</a><br>
</td><td width="25%" valign=top><a href="pyfits.html">pyfits</a><br>
<a href="string.html">string</a><br>
<a href="subprocess.html">subprocess</a><br>
<a href="sys.html">sys</a><br>
</td><td width="25%" valign=top><a href="time.html">time</a><br>
<a href="types.html">types</a><br>
<a href="urllib.html">urllib</a><br>
<a href="wcsclass.html">wcsclass</a><br>
</td><td width="25%" valign=top><a href="xmlUtil.html">xmlUtil</a><br>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
    
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="astrometer.html#gscMatchup">gscMatchup</a>
</font></dt><dt><font face="helvetica, arial"><a href="exceptions.html#IOError">exceptions.IOError</a>(<a href="exceptions.html#EnvironmentError">exceptions.EnvironmentError</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="astrometer.html#WebQueryError">WebQueryError</a>
</font></dt></dl>
</dd>
</dl>
 <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="WebQueryError">class <strong>WebQueryError</strong></a>(<a href="exceptions.html#IOError">exceptions.IOError</a>)</font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>Provides&nbsp;an&nbsp;exception&nbsp;class&nbsp;for&nbsp;web&nbsp;query&nbsp;errors&nbsp;and&nbsp;timeouts.<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="astrometer.html#WebQueryError">WebQueryError</a></dd>
<dd><a href="exceptions.html#IOError">exceptions.IOError</a></dd>
<dd><a href="exceptions.html#EnvironmentError">exceptions.EnvironmentError</a></dd>
<dd><a href="exceptions.html#StandardError">exceptions.StandardError</a></dd>
<dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd>
</dl>
<hr>
Methods inherited from <a href="exceptions.html#EnvironmentError">exceptions.EnvironmentError</a>:<br>
<dl><dt><a name="WebQueryError-__init__"><strong>__init__</strong></a>(...)</dt></dl>

<dl><dt><a name="WebQueryError-__str__"><strong>__str__</strong></a>(...)</dt></dl>

<hr>
Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
<dl><dt><a name="WebQueryError-__getitem__"><strong>__getitem__</strong></a>(...)</dt></dl>

</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="gscMatchup">class <strong>gscMatchup</strong></a></font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>This&nbsp;class&nbsp;provides&nbsp;various&nbsp;methods&nbsp;for&nbsp;searching&nbsp;and&nbsp;matching<br>
against&nbsp;extended&nbsp;version&nbsp;of&nbsp;GSC2&nbsp;catalog,&nbsp;determining&nbsp;the&nbsp;pointing<br>
error,&nbsp;and&nbsp;correcting&nbsp;the&nbsp;image&nbsp;header&nbsp;CRVAL1,CRVAL2&nbsp;keywords.<br>
The&nbsp;methods&nbsp;have&nbsp;mostly&nbsp;been&nbsp;cobbled&nbsp;together&nbsp;from&nbsp;Rick's&nbsp;scripts&nbsp;and<br>
apsis&nbsp;align&nbsp;module&nbsp;functions.<br>
&nbsp;<br>
Pipeline&nbsp;should&nbsp;run&nbsp;it&nbsp;like&nbsp;this:<br>
&nbsp;<br>
&nbsp;&nbsp;mm=astrometer.<a href="#gscMatchup">gscMatchup</a>(obs)<br>
&nbsp;&nbsp;if&nbsp;(mm.<a href="#gscMatchup-findAstromCorrs">findAstromCorrs</a>()&nbsp;!=&nbsp;0):<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;then&nbsp;it&nbsp;didn't&nbsp;work!<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;note&nbsp;this&nbsp;in&nbsp;long&nbsp;and&nbsp;move&nbsp;on&nbsp;to&nbsp;next&nbsp;module<br>
&nbsp;&nbsp;else:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mm.<a href="#gscMatchup-applyCorrs">applyCorrs</a>()<br>
&nbsp;<br>
The&nbsp;mkMsg&nbsp;method&nbsp;is&nbsp;remains&nbsp;callable,&nbsp;though&nbsp;deprecated&nbsp;for&nbsp;pipeline<br>
purposes&nbsp;as&nbsp;this&nbsp;module&nbsp;and&nbsp;class&nbsp;is&nbsp;used&nbsp;by&nbsp;the&nbsp;combDither&nbsp;module&nbsp;rather<br>
than&nbsp;called&nbsp;directly&nbsp;by&nbsp;the&nbsp;pipeline.<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="gscMatchup-__init__"><strong>__init__</strong></a>(self, obs)</dt><dd><tt>constructor&nbsp;gets&nbsp;Observation&nbsp;object&nbsp;(obs)&nbsp;from&nbsp;pipeline.</tt></dd></dl>

<dl><dt><a name="gscMatchup-applyCorrs"><strong>applyCorrs</strong></a>(self)</dt><dd><tt>Apply&nbsp;the&nbsp;astrometric&nbsp;corrections:<br>
update&nbsp;sci,context,weight,RMS&nbsp;image&nbsp;header&nbsp;CRVAL1,CRVAL2&nbsp;values.</tt></dd></dl>

<dl><dt><a name="gscMatchup-doMatching"><strong>doMatching</strong></a>(self)</dt><dd><tt>Match&nbsp;object&nbsp;.proj&nbsp;catalogs&nbsp;against&nbsp;GSC&nbsp;proj&nbsp;catalog.</tt></dd></dl>

<dl><dt><a name="gscMatchup-findAstromCorrs"><strong>findAstromCorrs</strong></a>(self)</dt><dd><tt>This&nbsp;'meta-method'&nbsp;&nbsp;runs&nbsp;the&nbsp;methods&nbsp;necessary&nbsp;for&nbsp;determining<br>
astrometric&nbsp;zeropoint&nbsp;corrections.</tt></dd></dl>

<dl><dt><a name="gscMatchup-makeGSCcat"><strong>makeGSCcat</strong></a>(self, chopSpur<font color="#909090">=0</font>)</dt><dd><tt>Constructs&nbsp;the&nbsp;GSC&nbsp;catalog&nbsp;file&nbsp;to&nbsp;be&nbsp;used&nbsp;in&nbsp;astrometric&nbsp;matching<br>
for&nbsp;this&nbsp;field.&nbsp;&nbsp;Name&nbsp;of&nbsp;catalog&nbsp;stored&nbsp;as&nbsp;parameter&nbsp;'self.<strong>GSCmatchin</strong>'.<br>
Returns&nbsp;0&nbsp;if&nbsp;successful,&nbsp;-1&nbsp;if&nbsp;not.</tt></dd></dl>

<dl><dt><a name="gscMatchup-makeObjcats"><strong>makeObjcats</strong></a>(self)</dt><dd><tt>Make&nbsp;object&nbsp;catalogs&nbsp;for&nbsp;all&nbsp;input&nbsp;science&nbsp;images.</tt></dd></dl>

<dl><dt><a name="gscMatchup-mkMsg"><strong>mkMsg</strong></a>(self)</dt><dd><tt>Create&nbsp;and&nbsp;write&nbsp;module&nbsp;level&nbsp;message&nbsp;for&nbsp;this&nbsp;class.<br>
Most&nbsp;of&nbsp;this&nbsp;is&nbsp;just&nbsp;compiling&nbsp;the&nbsp;info.&nbsp;meta&nbsp;is&nbsp;a&nbsp;dictionary<br>
of&nbsp;lists&nbsp;where&nbsp;each&nbsp;list&nbsp;is&nbsp;a&nbsp;list&nbsp;of&nbsp;tuples&nbsp;describing&nbsp;the<br>
tag&nbsp;lines&nbsp;for&nbsp;the&nbsp;particular&nbsp;section&nbsp;of&nbsp;the&nbsp;message.&nbsp;&nbsp;This&nbsp;tuple&nbsp;<br>
format&nbsp;conforms&nbsp;to&nbsp;that&nbsp;used&nbsp;by&nbsp;the&nbsp;xmlMessage&nbsp;class&nbsp;which&nbsp;is<br>
modeled&nbsp;on&nbsp;basic&nbsp;python&nbsp;argument&nbsp;passing,&nbsp;i.e.&nbsp;(key,*value,**attr).</tt></dd></dl>

<dl><dt><a name="gscMatchup-webquery"><strong>webquery</strong></a>(self, args<font color="#909090">=()</font>, **kw)</dt><dd><tt>Write&nbsp;output&nbsp;of&nbsp;a&nbsp;specified&nbsp;URL&nbsp;to&nbsp;stdout&nbsp;or&nbsp;file.<br>
Keywords&nbsp;for&nbsp;query&nbsp;may&nbsp;be&nbsp;specified&nbsp;as&nbsp;a&nbsp;sequence&nbsp;of&nbsp;pairs&nbsp;in<br>
args&nbsp;or&nbsp;as&nbsp;keywords.&nbsp;&nbsp;Special&nbsp;keywords&nbsp;that&nbsp;define&nbsp;the&nbsp;URL&nbsp;include:<br>
host&nbsp;(default&nbsp;'localhost'),&nbsp;url&nbsp;(default&nbsp;null),&nbsp;method&nbsp;(default&nbsp;'POST'),<br>
and&nbsp;port&nbsp;(default&nbsp;80).&nbsp;&nbsp;The&nbsp;file&nbsp;keyword&nbsp;specifies&nbsp;an&nbsp;output&nbsp;filename<br>
or&nbsp;file&nbsp;handle&nbsp;(default&nbsp;sys.stdout).&nbsp;&nbsp;Additional&nbsp;keywords&nbsp;are&nbsp;passed<br>
as&nbsp;parameters&nbsp;to&nbsp;the&nbsp;query.<br>
&nbsp;&nbsp;&nbsp;&nbsp;This&nbsp;method&nbsp;swiped&nbsp;in&nbsp;toto&nbsp;from&nbsp;Rick.</tt></dd></dl>

<dl><dt><a name="gscMatchup-writeXml"><strong>writeXml</strong></a>(self)</dt><dd><tt>This&nbsp;module&nbsp;must&nbsp;remark&nbsp;the&nbsp;image&nbsp;headers&nbsp;with&nbsp;Apsis&nbsp;xml.</tt></dd></dl>

</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
    
<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><strong>MAXWQtry</strong> = 10<br>
<strong>__author__</strong> = 'J. Blakeslee, R. White, K. Anderson'<br>
<strong>__version__</strong> = '1.8'<br>
<strong>__version_date__</strong> = '2006/05/22 17:38:53'<br>
<strong>pyversion</strong> = '2.4.3 (#1, Jan 14 2008, 18:32:40) <font color="#c040c0">\n</font>[GCC 4.1.2 20070626 (Red Hat 4.1.2-14)]'</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#7799ee">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr>
    
<tr><td bgcolor="#7799ee"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">J.&nbsp;Blakeslee,&nbsp;R.&nbsp;White,&nbsp;K.&nbsp;Anderson</td></tr></table>
</body></html>